/**
 *
 */
import Util;
import OpenApi;

import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  

  checkConfig(config);
  @endpoint = getEndpoint('multimediaai', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model CreateCoverTaskRequest {
  applicationId?: string(name='ApplicationId'),
  videoName?: string(name='VideoName'),
  videoUrl?: string(name='VideoUrl'),
  templateId?: long(name='TemplateId'),
  callbackUrl?: string(name='CallbackUrl'),
  scales?: string(name='Scales'),
}

model CreateCoverTaskResponseBody = {
  taskId?: long(name='TaskId'),
  requestId?: string(name='RequestId'),
}

model CreateCoverTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateCoverTaskResponseBody(name='body'),
}

async function createCoverTaskWithOptions(request: CreateCoverTaskRequest, runtime: Util.RuntimeOptions): CreateCoverTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateCoverTask', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createCoverTask(request: CreateCoverTaskRequest): CreateCoverTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCoverTaskWithOptions(request, runtime);
}

model CreateFaceGroupRequest {
  faceGroupName?: string(name='FaceGroupName'),
  description?: string(name='Description'),
}

model CreateFaceGroupResponseBody = {
  requestId?: string(name='RequestId'),
  faceGroupId?: long(name='FaceGroupId'),
}

model CreateFaceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: CreateFaceGroupResponseBody(name='body'),
}

async function createFaceGroupWithOptions(request: CreateFaceGroupRequest, runtime: Util.RuntimeOptions): CreateFaceGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateFaceGroup', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createFaceGroup(request: CreateFaceGroupRequest): CreateFaceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFaceGroupWithOptions(request, runtime);
}

model CreateFacePersonRequest {
  faceGroupId?: long(name='FaceGroupId'),
  facePersonName?: string(name='FacePersonName'),
  imageUrls?: string(name='ImageUrls'),
}

model CreateFacePersonResponseBody = {
  requestId?: string(name='RequestId'),
  facePersonId?: long(name='FacePersonId'),
}

model CreateFacePersonResponse = {
  headers: map[string]string(name='headers'),
  body: CreateFacePersonResponseBody(name='body'),
}

async function createFacePersonWithOptions(request: CreateFacePersonRequest, runtime: Util.RuntimeOptions): CreateFacePersonResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateFacePerson', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createFacePerson(request: CreateFacePersonRequest): CreateFacePersonResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFacePersonWithOptions(request, runtime);
}

model CreateGifTaskRequest {
  applicationId?: string(name='ApplicationId'),
  videoName?: string(name='VideoName'),
  videoUrl?: string(name='VideoUrl'),
  templateId?: long(name='TemplateId'),
  callbackUrl?: string(name='CallbackUrl'),
  scales?: string(name='Scales'),
}

model CreateGifTaskResponseBody = {
  taskId?: long(name='TaskId'),
  requestId?: string(name='RequestId'),
}

model CreateGifTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateGifTaskResponseBody(name='body'),
}

async function createGifTaskWithOptions(request: CreateGifTaskRequest, runtime: Util.RuntimeOptions): CreateGifTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateGifTask', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createGifTask(request: CreateGifTaskRequest): CreateGifTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGifTaskWithOptions(request, runtime);
}

model CreateLabelTaskRequest {
  applicationId?: string(name='ApplicationId'),
  videoName?: string(name='VideoName'),
  videoUrl?: string(name='VideoUrl'),
  templateId?: long(name='TemplateId'),
  callbackUrl?: string(name='CallbackUrl'),
}

model CreateLabelTaskResponseBody = {
  taskId?: long(name='TaskId'),
  requestId?: string(name='RequestId'),
}

model CreateLabelTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateLabelTaskResponseBody(name='body'),
}

async function createLabelTaskWithOptions(request: CreateLabelTaskRequest, runtime: Util.RuntimeOptions): CreateLabelTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateLabelTask', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createLabelTask(request: CreateLabelTaskRequest): CreateLabelTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLabelTaskWithOptions(request, runtime);
}

model CreateTemplateRequest {
  templateName?: string(name='TemplateName'),
  content?: string(name='Content'),
  isDefault?: boolean(name='IsDefault'),
  type?: int32(name='Type'),
}

model CreateTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  templateId?: string(name='TemplateId'),
}

model CreateTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: CreateTemplateResponseBody(name='body'),
}

async function createTemplateWithOptions(request: CreateTemplateRequest, runtime: Util.RuntimeOptions): CreateTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateTemplate', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createTemplate(request: CreateTemplateRequest): CreateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTemplateWithOptions(request, runtime);
}

model DeleteFaceGroupRequest {
  faceGroupId?: long(name='FaceGroupId'),
}

model DeleteFaceGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteFaceGroupResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteFaceGroupResponseBody(name='body'),
}

async function deleteFaceGroupWithOptions(request: DeleteFaceGroupRequest, runtime: Util.RuntimeOptions): DeleteFaceGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteFaceGroup', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteFaceGroup(request: DeleteFaceGroupRequest): DeleteFaceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceGroupWithOptions(request, runtime);
}

model DeleteFaceImageRequest {
  faceGroupId?: long(name='FaceGroupId'),
  facePersonId?: long(name='FacePersonId'),
  faceImageId?: long(name='FaceImageId'),
}

model DeleteFaceImageResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteFaceImageResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteFaceImageResponseBody(name='body'),
}

async function deleteFaceImageWithOptions(request: DeleteFaceImageRequest, runtime: Util.RuntimeOptions): DeleteFaceImageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteFaceImage', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteFaceImage(request: DeleteFaceImageRequest): DeleteFaceImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaceImageWithOptions(request, runtime);
}

model DeleteFacePersonRequest {
  faceGroupId?: long(name='FaceGroupId'),
  facePersonId?: long(name='FacePersonId'),
}

model DeleteFacePersonResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteFacePersonResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteFacePersonResponseBody(name='body'),
}

async function deleteFacePersonWithOptions(request: DeleteFacePersonRequest, runtime: Util.RuntimeOptions): DeleteFacePersonResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteFacePerson', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteFacePerson(request: DeleteFacePersonRequest): DeleteFacePersonResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFacePersonWithOptions(request, runtime);
}

model GetTaskResultRequest {
  taskId?: long(name='TaskId'),
}

model GetTaskResultResponseBody = {
  status?: int32(name='Status'),
  requestId?: string(name='RequestId'),
  result?: {
    errorName?: string(name='ErrorName'),
    errorMessage?: string(name='ErrorMessage'),
    errorCode?: string(name='ErrorCode'),
    videoName?: string(name='VideoName'),
    analysisUseTime?: long(name='AnalysisUseTime'),
    processResultUrl?: string(name='ProcessResultUrl'),
    applicationId?: string(name='ApplicationId'),
    errorReason?: string(name='ErrorReason'),
    videoUrl?: string(name='VideoUrl'),
  }(name='Result'),
}

model GetTaskResultResponse = {
  headers: map[string]string(name='headers'),
  body: GetTaskResultResponseBody(name='body'),
}

async function getTaskResultWithOptions(request: GetTaskResultRequest, runtime: Util.RuntimeOptions): GetTaskResultResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetTaskResult', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getTaskResult(request: GetTaskResultRequest): GetTaskResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTaskResultWithOptions(request, runtime);
}

model GetTaskStatusRequest {
  taskId?: long(name='TaskId'),
}

model GetTaskStatusResponseBody = {
  status?: int32(name='Status'),
  requestId?: string(name='RequestId'),
}

model GetTaskStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetTaskStatusResponseBody(name='body'),
}

async function getTaskStatusWithOptions(request: GetTaskStatusRequest, runtime: Util.RuntimeOptions): GetTaskStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetTaskStatus', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getTaskStatus(request: GetTaskStatusRequest): GetTaskStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTaskStatusWithOptions(request, runtime);
}

model GetTemplateRequest {
  templateId?: long(name='TemplateId'),
}

model GetTemplateResponseBody = {
  isDefault?: boolean(name='IsDefault'),
  category?: int32(name='Category'),
  requestId?: string(name='RequestId'),
  content?: map[string]any(name='Content'),
  createTime?: string(name='CreateTime'),
  updateTime?: string(name='UpdateTime'),
  templateName?: string(name='TemplateName'),
  templateId?: string(name='TemplateId'),
}

model GetTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: GetTemplateResponseBody(name='body'),
}

async function getTemplateWithOptions(request: GetTemplateRequest, runtime: Util.RuntimeOptions): GetTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetTemplate', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getTemplate(request: GetTemplateRequest): GetTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTemplateWithOptions(request, runtime);
}

model ListFaceGroupsRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListFaceGroupsResponseBody = {
  totalCount?: long(name='TotalCount'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  faceGroups?: [ 
    {
      description?: string(name='Description'),
      faceGroupName?: string(name='FaceGroupName'),
      personCount?: long(name='PersonCount'),
      imageCount?: long(name='ImageCount'),
      faceGroupId?: long(name='FaceGroupId'),
      templates?: [ 
        {
          name?: string(name='Name'),
          id?: string(name='Id'),
        }
      ](name='Templates'),
    }
  ](name='FaceGroups'),
}

model ListFaceGroupsResponse = {
  headers: map[string]string(name='headers'),
  body: ListFaceGroupsResponseBody(name='body'),
}

async function listFaceGroupsWithOptions(request: ListFaceGroupsRequest, runtime: Util.RuntimeOptions): ListFaceGroupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListFaceGroups', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listFaceGroups(request: ListFaceGroupsRequest): ListFaceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFaceGroupsWithOptions(request, runtime);
}

model ListFaceImagesRequest {
  faceGroupId?: long(name='FaceGroupId'),
  facePersonId?: long(name='FacePersonId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListFaceImagesResponseBody = {
  totalCount?: long(name='TotalCount'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  faceImages?: [ 
    {
      faceRectangle?: [ float ](name='FaceRectangle'),
      imageUrl?: string(name='ImageUrl'),
      faceImageId?: long(name='FaceImageId'),
    }
  ](name='FaceImages'),
}

model ListFaceImagesResponse = {
  headers: map[string]string(name='headers'),
  body: ListFaceImagesResponseBody(name='body'),
}

async function listFaceImagesWithOptions(request: ListFaceImagesRequest, runtime: Util.RuntimeOptions): ListFaceImagesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListFaceImages', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listFaceImages(request: ListFaceImagesRequest): ListFaceImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFaceImagesWithOptions(request, runtime);
}

model ListFacePersonsRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  faceGroupId?: long(name='FaceGroupId'),
  facePersonName?: string(name='FacePersonName'),
}

model ListFacePersonsResponseBody = {
  totalCount?: long(name='TotalCount'),
  facePersons?: [ 
    {
      imageUrl?: string(name='ImageUrl'),
      imageCount?: long(name='ImageCount'),
      facePersonId?: long(name='FacePersonId'),
      facePersonName?: string(name='FacePersonName'),
    }
  ](name='FacePersons'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
}

model ListFacePersonsResponse = {
  headers: map[string]string(name='headers'),
  body: ListFacePersonsResponseBody(name='body'),
}

async function listFacePersonsWithOptions(request: ListFacePersonsRequest, runtime: Util.RuntimeOptions): ListFacePersonsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListFacePersons', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listFacePersons(request: ListFacePersonsRequest): ListFacePersonsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listFacePersonsWithOptions(request, runtime);
}

model ListTemplatesRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  templateId?: long(name='TemplateId'),
  templateName?: string(name='TemplateName'),
  type?: int32(name='Type'),
}

model ListTemplatesResponseBody = {
  totalCount?: long(name='TotalCount'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  templates?: [ 
    {
      type?: int32(name='Type'),
      isDefault?: boolean(name='IsDefault'),
      updateTime?: string(name='UpdateTime'),
      createTime?: string(name='CreateTime'),
      templateName?: string(name='TemplateName'),
      templateId?: string(name='TemplateId'),
    }
  ](name='Templates'),
  totalAmount?: long(name='TotalAmount'),
}

model ListTemplatesResponse = {
  headers: map[string]string(name='headers'),
  body: ListTemplatesResponseBody(name='body'),
}

async function listTemplatesWithOptions(request: ListTemplatesRequest, runtime: Util.RuntimeOptions): ListTemplatesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTemplates', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTemplates(request: ListTemplatesRequest): ListTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTemplatesWithOptions(request, runtime);
}

model ProcessFaceAlgorithmRequest {
  data?: string(name='Data'),
  appKey?: string(name='AppKey'),
}

model ProcessFaceAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessFaceAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessFaceAlgorithmResponseBody(name='body'),
}

async function processFaceAlgorithmWithOptions(request: ProcessFaceAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessFaceAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessFaceAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processFaceAlgorithm(request: ProcessFaceAlgorithmRequest): ProcessFaceAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processFaceAlgorithmWithOptions(request, runtime);
}

model ProcessImageTagAlgorithmRequest {
  data?: string(name='Data'),
  appKey?: string(name='AppKey'),
}

model ProcessImageTagAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessImageTagAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessImageTagAlgorithmResponseBody(name='body'),
}

async function processImageTagAlgorithmWithOptions(request: ProcessImageTagAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessImageTagAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessImageTagAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processImageTagAlgorithm(request: ProcessImageTagAlgorithmRequest): ProcessImageTagAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processImageTagAlgorithmWithOptions(request, runtime);
}

model ProcessLandmarkAlgorithmRequest {
  data?: string(name='Data'),
  appKey?: string(name='AppKey'),
}

model ProcessLandmarkAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessLandmarkAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessLandmarkAlgorithmResponseBody(name='body'),
}

async function processLandmarkAlgorithmWithOptions(request: ProcessLandmarkAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessLandmarkAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessLandmarkAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processLandmarkAlgorithm(request: ProcessLandmarkAlgorithmRequest): ProcessLandmarkAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processLandmarkAlgorithmWithOptions(request, runtime);
}

model ProcessLogoAlgorithmRequest {
  data?: string(name='Data'),
  appKey?: string(name='AppKey'),
}

model ProcessLogoAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessLogoAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessLogoAlgorithmResponseBody(name='body'),
}

async function processLogoAlgorithmWithOptions(request: ProcessLogoAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessLogoAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessLogoAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processLogoAlgorithm(request: ProcessLogoAlgorithmRequest): ProcessLogoAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processLogoAlgorithmWithOptions(request, runtime);
}

model ProcessNewsAlgorithmRequest {
  data?: string(name='Data'),
  appKey?: string(name='AppKey'),
}

model ProcessNewsAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessNewsAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessNewsAlgorithmResponseBody(name='body'),
}

async function processNewsAlgorithmWithOptions(request: ProcessNewsAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessNewsAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessNewsAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processNewsAlgorithm(request: ProcessNewsAlgorithmRequest): ProcessNewsAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processNewsAlgorithmWithOptions(request, runtime);
}

model ProcessNlpAlgorithmRequest {
  appKey?: string(name='AppKey'),
  data?: string(name='Data'),
}

model ProcessNlpAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessNlpAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessNlpAlgorithmResponseBody(name='body'),
}

async function processNlpAlgorithmWithOptions(request: ProcessNlpAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessNlpAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessNlpAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processNlpAlgorithm(request: ProcessNlpAlgorithmRequest): ProcessNlpAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processNlpAlgorithmWithOptions(request, runtime);
}

model ProcessOcrAlgorithmRequest {
  appKey?: string(name='AppKey'),
  data?: string(name='Data'),
}

model ProcessOcrAlgorithmResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: int32(name='Code'),
}

model ProcessOcrAlgorithmResponse = {
  headers: map[string]string(name='headers'),
  body: ProcessOcrAlgorithmResponseBody(name='body'),
}

async function processOcrAlgorithmWithOptions(request: ProcessOcrAlgorithmRequest, runtime: Util.RuntimeOptions): ProcessOcrAlgorithmResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ProcessOcrAlgorithm', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function processOcrAlgorithm(request: ProcessOcrAlgorithmRequest): ProcessOcrAlgorithmResponse {
  var runtime = new Util.RuntimeOptions{};
  return processOcrAlgorithmWithOptions(request, runtime);
}

model RegisterFaceImageRequest {
  faceGroupId?: long(name='FaceGroupId'),
  facePersonId?: long(name='FacePersonId'),
  imageUrl?: string(name='ImageUrl'),
}

model RegisterFaceImageResponseBody = {
  requestId?: string(name='RequestId'),
  faceImages?: [ 
    {
      faceImageId?: long(name='FaceImageId'),
    }
  ](name='FaceImages'),
}

model RegisterFaceImageResponse = {
  headers: map[string]string(name='headers'),
  body: RegisterFaceImageResponseBody(name='body'),
}

async function registerFaceImageWithOptions(request: RegisterFaceImageRequest, runtime: Util.RuntimeOptions): RegisterFaceImageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RegisterFaceImage', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function registerFaceImage(request: RegisterFaceImageRequest): RegisterFaceImageResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerFaceImageWithOptions(request, runtime);
}

model UpdateTemplateRequest {
  templateId?: string(name='TemplateId'),
  templateName?: string(name='TemplateName'),
  content?: string(name='Content'),
  isDefault?: boolean(name='IsDefault'),
  type?: int32(name='Type'),
}

model UpdateTemplateResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateTemplateResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateTemplateResponseBody(name='body'),
}

async function updateTemplateWithOptions(request: UpdateTemplateRequest, runtime: Util.RuntimeOptions): UpdateTemplateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateTemplate', '2019-08-10', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateTemplate(request: UpdateTemplateRequest): UpdateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTemplateWithOptions(request, runtime);
}

